<?php
$title = '客户';
$this->headTitle($title);
?>
<h1><?php echo $this->escapeHtml($title); ?></h1>
<hr>
<table id="client-table" class="table table-hover table-striped">
    <tr>
        <th>身份证号</th>
        <th>姓名</th>
        <th>城市</th>
        <th>利润</th>
        <th>星级</th>
        <th>账户</th>
        <th>贷款</th>
        <th>操作</th>
    </tr>
    <?php foreach ($this->clients as $client): ?>
        <tr>
            <td><?php echo $client['client_id']; ?></td>
            <td><?php echo $client['client_name']; ?></td>
            <td><?php echo $client['client_city']; ?></td>
            <td><?php echo $client['account_profit']; ?></td>
            <td><span class="badge" style="background-color: #3e8f3e;"><?php echo $client['star_level']; ?></span></td>
            <td>
                <a href="<?php echo $this->url("client/default", array("controller" => "account", "action" => "index", "id" => $client["client_id"])); ?>">查看</a>
            </td>
            <td>
                <a href="<?php echo $this->url("client/default", array("controller" => "loan", "action" => "index", "id" => $client["client_id"])); ?>">查看</a>
            </td>
            <td>
                <a class="btn btn-default"
                   href="<?php echo $this->url("client/default", array("controller" => "client", "action" => "edit", "id" => $client["client_id"])); ?>">编辑</a>
                <a class="btn btn-danger"
                   href="<?php echo $this->url("client/default", array("controller" => "client", "action" => "delete", "id" => $client["client_id"])); ?>">删除</a>
            </td>
        </tr>
    <?php endforeach; ?>
    <tr>
        <th>合计</th>
        <td></td>
        <td></td>
        <td><?php echo $this->client_profit; ?></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
    </tr>
</table>